﻿<%@ Page Title="Title" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" MasterPageFile="~/Views/Shared/Demo.Master" %>

<%@ Register TagPrefix="o" Namespace="Omu.AwesomeWebForms" Assembly="Omu.AwesomeWebForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e8b65a0968999f7e" %>
<asp:Content runat="server" ID="Demo" ContentPlaceHolderID="DemoContent">
<h1>MultiLookup</h1>
<p class="xpl">a readonly field with a button near it, on button click a window pops up, where user can search, select and deselect multiple values</p>
<h2>
            MultiLookup with pagination (more results button)
        </h2>        

        <o:MultiLookup runat="server" ID="Fruits" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitSearch' SelectedUrl="~/svc/aja.svc/FruitSelected"
            Value='["1","2","3"]' FullScreen="True"
            Title="Select items and by clicking the up and down buttons" ClearButton="true" />
        <h2>
            bound to ajaxdropdown using parentId</h2>
        unlike the AjaxDropdown the Multilookup will keep its value when the value of its
        parent is changed<br />
        can be bound to anything else HiddenField, TextBox, Multilookup etc.<br />
        <o:AjaxDropdown runat="server" ID="Categories" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
       
        <%
            FruitsByCategory.ParentId = Categories.ClientID;
        %>
        <o:MultiLookup runat="server" ID="FruitsByCategory" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch' SelectedUrl="~/svc/aja.svc/FruitSelected" Modal="true" Value="[4,5]" />
        <h2>
            Bound to 2 dropdowns (using Data)</h2>
        <o:AjaxDropdown runat="server" ID="Cat1" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <o:AjaxDropdown runat="server" ID="Cat2" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>
        <%
            FruitsFrom2Cat.Data = new Dictionary<string, string>
                                      {
                                          {"cat1", Cat1.ClientID},
                                          {"cat2", Cat2.ClientID},
                                      };
%>
        <o:MultiLookup runat="server" ID="FruitsFrom2Cat" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsFrom2CatSearch' SelectedUrl="~/svc/aja.svc/FruitSelected" Value="[3,4,5]" />
            
            <h2>send predefined parameters</h2>
            <%
                FruitsByCategoryPar.Parameters = new Dictionary<string, string>{{"parent","3"}};
                 %>
            <o:MultiLookup runat="server" ID="FruitsByCategoryPar" GetMultipleUrl="~/svc/aja.svc/FruitGetMultiple"
            SearchUrl='~/svc/aja.svc/FruitsByCategorySearch' SelectedUrl="~/svc/aja.svc/FruitSelected"            
            FullScreen="true" Value="[21,22,24]" />       
</asp:Content>
